

wait_time_short = 1
wait_time1_long = 2

# flask
from flask import Flask, request, jsonify

import jtaq

app = Flask(__name__)


@app.route('/getcookies', methods=["POST"])
def calculate():
    params = request.form if request.form else request.json
    print(params)
    username = params.get("username", 0)
    password = params.get("password", 0)

    jt = jtaq.jtaq(username,password)
    cookies = jt.getLogin()

    res = {"cookies": cookies}
    return jsonify(content_type='application/json;charset=utf-8',
                   reason='success',
                   charset='utf-8',
                   status='200',
                   content=res)

if __name__ == '__main__':
    app.run(host='0.0.0.0',
            threaded=True,
            debug=True,
            port=8868)